package com.sright.bcard.cms.mvc;

import com.sright.bcard.cms.intercepter.LoginIntercepter;
import com.sright.bcard.common.service.share.mvcresolver.RequestBodyArgumentResolver;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;

/**
 * Author: lumf
 * Date: 2020/8/13 1:52 PM
 */
@Configuration
public class CmsWebMvcConfigurer implements WebMvcConfigurer {

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginIntercepter());
    }

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> resolvers) {
        resolvers.add(new RequestBodyArgumentResolver());
    }
}
